package com.zhny.aiot.bighouse.plugin;

import com.zhny.aiot.bighouse.plugin.model.BigHouseStoreEntry;
import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.modbus.ModemServer;
import com.zhny.aiot.plugin.modbus.device.ModemConfig;
import com.zhny.aiot.plugin.modbus.device.ModemDeviceFactory;
import com.zhny.aiot.plugin.modbus.handler.model.ModemRequestMessage;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class BigHousePlugin extends Plugin {
    public BigHousePlugin(PluginWrapper wrapper) {
        super(wrapper);
    }
    @Extension
    public static class BigHouseFactory extends ModemDeviceFactory<BigHouseStoreEntry> {

        public ModemRequestMessage getRequestMessage(ModemConfig modemConfig) {
            return null;
        }

        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new BigHouseDevice (ModemServer.getInstance ().getEngine () ,this,iCenterFacilities,entity);
        }

        public Class<? extends StoreEntity> storeClass() {
            return BigHouseStoreEntry.class;
        }

        public String getId() {
            return "zhny-bighouse-plugin";
        }

        public String getName() {
            return "智慧农业大棚控制柜插件";
        }

        public FactoryType getType() {
            return FactoryType.GreenHouse;
        }
    }

}
